{% extends "base/base.html" %}

{% comment %}

 Copyright 2013 - Tom Alessi

 Licensed under the Apache License, Version 2.0 (the "License");
 you may not use this file except in compliance with the License.
 You may obtain a copy of the License at

     http://www.apache.org/licenses/LICENSE-2.0

 Unless required by applicable law or agreed to in writing, software
 distributed under the License is distributed on an "AS IS" BASIS,
 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 See the License for the specific language governing permissions and 
 limitations under the License.

{% endcomment %}


{% block content %}

<b><i>CRAWL ERROR TRENDS</i></b>

<br>
<br>


  <script>
   // Date Pickers and Submit
   $(function() {

      //From Date
      $("#date_from").datepicker({dateFormat: 'yy-mm-dd'});

      //To Date
      $("#date_to").datepicker({dateFormat: 'yy-mm-dd'});

      //Submit
      $("#submit").button();
   });
  </script>

  
  <script>
   // Submit
   $(function() {

      //Submit
      $("#submit").button();
   });
  </script>



   <form name="ce_select" id="ce_select" action="/webmaster/trends" method="get">
    <table>

     <tr>
      <td>Domain</td>
      <td>
       <select class="standard" name="domain" id="domain">
       {% for domain in domains %}
           <option value="{{domain}}">{{domain}}</option>
       {% endfor %}
       </select>
      </td>
     </tr>

     <tr>
      <td>Error Type</td>
      <td>
       <select class="standard" name="error_id" id="error_id">
       {% for error in error_types %}
           <option value="{{error.id}}">{{error.type}}</option>
       {% endfor %}
       </select>
      </td>
     </tr>

     <tr>
       <td>
        Date from
       </td>
       <td>
        <input class="input_date" name="date_from" id="date_from" type="text" value="{{date_from}}">
       </td>
     <tr>

     <tr>
       <td>
        Date to
       </td>
       <td>
        <input class="input_date" name="date_to" id="date_to" type="text" value="{{date_to}}">
       </td>
     <tr>

     <tr>
      <td></td>
      <td>
       <input class="submit-button" id="submit" type="submit" value="submit" style="width:75"/>
      </td>
     </tr>

     <tr>
      <td></td>
      <td>
       <p class="error">
        {% if form.date_to.errors %}
         <br>{% for error in form.date_to.errors %}{{error}}{% endfor %}
        {% endif %}
        {% if form.date_from.errors %}
         <br>{% for error in form.date_from.errors %}{{error}}{% endfor %}
        {% endif %}
        {% if form.domain.errors %}
         <br>{% for error in form.domain.errors %}{{error}}{% endfor %}
        {% endif %}
        {% if form.error_id.errors %}
         <br>{% for error in form.error_id.errors %}{{error}}{% endfor %}
        {% endif %}
        {% if form.format.errors %}
         <br>{% for error in form.format.errors %}{{error}}{% endfor %}
        {% endif %}
       </p>
      </td>
     </tr>

    </table>
   </form>


{% endblock %}
